package com.icloud.common.database.model;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

@Getter
@Setter
@TableName("article")
@ApiModel(value = "Article对象", description = "帖子表")
@EqualsAndHashCode
public class Article implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @EqualsAndHashCode.Include
    private Long id;

    @ApiModelProperty("创建时间")
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @ApiModelProperty("修改时间")
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @ApiModelProperty("创建人id")
    @TableField("created_id")
    private Long createdId;

    @ApiModelProperty("经度")
    @TableField("longitude")
    private String longitude;

    @ApiModelProperty("纬度")
    @TableField("latitude")
    private String latitude;

    @ApiModelProperty("可见范围,ALL-所有人,HOME-仅主页可见,FORBIDDEN-不让他看,STRANGER-仅陌生人可见,SQUARE-仅动态广场可见,SELF-仅自己可见")
    @TableField("visible")
    private String visible;

    @ApiModelProperty("权限:是否禁止下载, TRUE, FALSE")
    @TableField("perm_down")
    private String permDown;

    @ApiModelProperty("权限:是否禁止分享, TRUE, FALSE")
    @TableField("perm_transmit")
    private String permTransmit;

    @ApiModelProperty("可评论范围 ALL,FOLLOWED,FOLLOW_ME,NO")
    @TableField("discussion")
    private String discussion;

    @ApiModelProperty("是否启用风控, TRUE, FALSE")
    @TableField("risk_ctl")
    private String riskCtl;

    @ApiModelProperty("状态, STOP, NORMAL")
    @TableField("`state`")
    private String state;

    @ApiModelProperty("状态, VIDEO, IMG")
    @TableField("`attachment_type`")
    private String attachmentType;

    @ApiModelProperty("是否删除，0:正常，1:删除")
    @TableField("is_delete")
    @TableLogic
    private Integer isDelete;

    @ApiModelProperty("内容")
    @TableField("content")
    private String content;

    @ApiModelProperty("原帖Id")
    @TableField("original_id")
    private Long originalId;

    @ApiModelProperty("分享人Id")
    @TableField("forward_id")
    private Long forwardId;
}
